package org.myspringmvc.web.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
 * @ClassName: DispatcherServlet
 * @Author: YLY
 * @Description: 前端控制器
 * @Date: 2025/9/21
 * @Version: 1.0
 */
public class DispatcherServlet extends HttpServlet {

    /**
     * 初始化
     * @throws ServletException
     */
    @Override
    public void init() throws ServletException {

    }

    /**
     * 请求处理
     * @param req
     * @param resp
     * @throws ServletException
     */
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
        doDispatch(req, resp);
    }

    /**
     * 请求处理
     * @param request
     * @param response
     * @throws ServletException
     */
    private void doDispatch(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    }

}
